package ua.kiev.tosik.price.modules.search.gui;

import ua.kiev.tosik.price.models.Prices;

import java.util.Vector;

public class Notepad {

	private Vector<Prices> prices;

	public Notepad() {
		prices = new Vector<Prices>();
	}

	public void addPrices(Vector<Prices> prices) {
		this.prices.addAll(prices);
	}

	public Vector<Prices> getPrices() {
		return prices;
	}

	public void setPrices(Vector<Prices> prices) {
		this.prices = prices;
	}

	public void clearPrices() {
		prices.clear();
	}

	public double getSum() {
		double sum = 0;
		for ( Prices p: getPrices() ) {
			sum += p.getPrice();
		}
		return sum;
	}

}
